package ics.zychen.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class ASqliteHelper extends SQLiteOpenHelper{

	public static final String SINA_TB_NAME="sina_users";
	public static final String RENREN_TB_NAME="renren_users";
	
	public ASqliteHelper(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL("CREATE TABLE IF NOT EXISTS "+

				RENREN_TB_NAME+"("+

                UserInfo.ID+" integer primary key,"+

                UserInfo.USERID+" varchar,"+

                UserInfo.USERNAME+" varchar,"+

                UserInfo.USERICON+" blob"+

                ")"

                );
		
		db.execSQL("CREATE TABLE IF NOT EXISTS "+

				SINA_TB_NAME+"("+

                UserInfo.ID+" integer primary key,"+

                UserInfo.USERID+" varchar,"+

                UserInfo.TOKEN+" varchar,"+

                UserInfo.TOKENSECRET+" varchar,"+

                UserInfo.USERNAME+" varchar,"+

                UserInfo.USERICON+" blob"+

                ")"

                );
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}

}
